using IM.Easy.Core.ServiceLifetime;
using IM.Easy.Core.Services;
using IM.Easy.Core.Utils;
using IM.Easy.Infrastructure.Query;
using IM.Easy.Entity.System;
using IM.Easy.SystemServices.Dtos;

namespace IM.Easy.SystemServices.IServices
{
    public interface IRoleMenuService
    {
        /// <summary>
        /// 创建一个新实体
        /// </summary>
        /// <param name="entity">要创建的实体</param>
        /// <returns>创建后的实体</returns>
        SysRoleMenu Create(SysRoleMenu entity);

        /// <summary>
        /// 根据 ID 获取实体
        /// </summary>
        /// <param name="id">实体的唯一标识</param>
        /// <returns>获取的实体</returns>
        SysRoleMenu GetById(long id);

        /// <summary>
        /// 获取所有实体
        /// </summary>
        /// <returns>所有实体的列表</returns>
        PageResponse<SysRoleMenu> GetPageList(RoleMenuQueryDto query);

        /// <summary>
        /// 更新一个已有的实体
        /// </summary>
        /// <param name="entity">更新后的实体</param>
        /// <returns>更新后的实体</returns>
        bool Update(SysRoleMenu entity);

        /// <summary>
        /// 根据 ID 删除实体
        /// </summary>
        /// <param name="id">要删除的实体的唯一标识</param>
        /// <returns>操作是否成功</returns>
        bool Delete(params long[] key);

        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        bool Save(long roleId, long[] menuIds);

        /// <summary>
        /// 获取菜单
        /// </summary>
        /// <param name="roldId"></param>
        /// <returns></returns>
        List<SysMenu> GetMenus(long roldId);

        /// <summary>
        /// 通过获取多角色菜单
        /// </summary>
        /// <param name="roleIds"></param>
        /// <returns></returns>
        List<SysMenu> GetMenus(params long[] roleIds);


        /// <summary>
        /// 通过角色标识获取菜单
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        List<SysMenu> GetMenus(string roleKey);
    }
}
